Perform a platform update with {policy-gen-cr} CRs
You can perform a platform update with the TALM.
-
Install the Topology Aware Lifecycle Manager (TALM).
-
Update GitOps Zero Touch Provisioning (ZTP) to the latest version.
-
Provision one or more managed clusters with GitOps ZTP.
-
Mirror the required image repository.
-
Log in as a user with
cluster-adminprivileges. -
Create RHACM policies in the hub cluster.
-
Create a
{policy-gen-cr}CR for the platform update:-
Save the following
{policy-gen-cr}CR in thedu-upgrade.yamlfile:The following example shows the
{policy-gen-cr}CR for platform update:The
{policy-gen-cr}CR generates two policies:-
The
du-upgrade-platform-upgrade-preppolicy does the preparation work for the platform update. It creates theConfigMapCR for the required release image signature, creates the image content source of the mirrored release image repository, and updates the cluster version with the required update channel and the update graph reachable by the managed cluster in the disconnected environment. -
The
du-upgrade-platform-upgradepolicy is used to perform platform upgrade.
-
-
Add the
du-upgrade.yamlfile contents to thekustomization.yamlfile located in the GitOps ZTP Git repository for the{policy-gen-cr}CRs and push the changes to the Git repository.ArgoCD pulls the changes from the Git repository and generates the policies on the hub cluster.
-
Check the created policies by running the following command:
$ oc get policies -A | grep platform-upgrade
-
-
Create the
ClusterGroupUpdateCR for the platform update with thespec.enablefield set tofalse.-
Save the content of the platform update
ClusterGroupUpdateCR with thedu-upgrade-platform-upgrade-prepand thedu-upgrade-platform-upgradepolicies and the target clusters to thecgu-platform-upgrade.ymlfile, as shown in the following example:apiVersion: ran.openshift.io/v1alpha1 kind: ClusterGroupUpgrade metadata: name: cgu-platform-upgrade namespace: default spec: managedPolicies: - du-upgrade-platform-upgrade-prep - du-upgrade-platform-upgrade preCaching: false clusters: - spoke1 remediationStrategy: maxConcurrency: 1 enable: false -
Apply the
ClusterGroupUpdateCR to the hub cluster by running the following command:$ oc apply -f cgu-platform-upgrade.yml
-
-
Optional: Precache the images for the platform update.
-
Enable precaching in the
ClusterGroupUpdateCR by running the following command:$ oc --namespace=default patch clustergroupupgrade.ran.openshift.io/cgu-platform-upgrade \ --patch '{"spec":{"preCaching": true}}' --type=merge -
Monitor the update process and wait for the pre-caching to complete. Check the status of pre-caching by running the following command on the hub cluster:
$ oc get cgu cgu-platform-upgrade -o jsonpath='{.status.precaching.status}'
-
-
Start the platform update:
-
Enable the
cgu-platform-upgradepolicy and disable pre-caching by running the following command:$ oc --namespace=default patch clustergroupupgrade.ran.openshift.io/cgu-platform-upgrade \ --patch '{"spec":{"enable":true, "preCaching": false}}' --type=merge -
Monitor the process. Upon completion, ensure that the policy is compliant by running the following command:
$ oc get policies --all-namespaces
-